'use strict';
angular.module('app').directive('appHeadBar',[function(){
    return{
        restrict : "A",
        replace:true,
        templateUrl:'view/template/headBar.html',
        scope:{
            text:"@"
        },
        link:function($scope){
            $scope.back = function(){
                window.history.back();
            };
            $scope.$on('abc',function(event,data){
                console.log(event,data);
            });//向上进行接受
            $scope.$emit('cba',{name:2});//向上进行广播
        }
    }
}]);